package com.tomcov.client;

import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.SimpleEventBus;
import com.google.gwt.place.shared.PlaceController;
import com.tomcov.client.service.JourneyServiceAsync;
import com.tomcov.client.service.MessageServiceAsync;
import com.tomcov.client.service.UserServiceAsync;
import com.tomcov.client.view.CreatUserView;
import com.tomcov.client.view.CreatUserViewImpl;
import com.tomcov.client.view.I18nView;
import com.tomcov.client.view.I18nViewImpl;
import com.tomcov.client.view.LicenceView;
import com.tomcov.client.view.LicenceViewImpl;
import com.tomcov.client.view.MapView;
import com.tomcov.client.view.MapViewImpl;
import com.tomcov.client.view.MessageInView;
import com.tomcov.client.view.MessageInViewImpl;
import com.tomcov.client.view.MessageOutView;
import com.tomcov.client.view.MessageOutViewImpl;
import com.tomcov.client.view.SettingsView;
import com.tomcov.client.view.SettingsViewImpl;
import com.tomcov.client.view.WelcomView;
import com.tomcov.client.view.WelcomViewImpl;

public class  ClientFactoryImpl implements ClientFactory{
	
	private UserServiceAsync USA;
	private JourneyServiceAsync JSA;
	private MessageServiceAsync MSA;
	
	private final EventBus eventBus = new SimpleEventBus();
	private final PlaceController placeController = new PlaceController(eventBus);
	private final WelcomView welcomview = (WelcomView) new WelcomViewImpl();
	private final I18nView i18nview = (I18nView) new I18nViewImpl();
	private final LicenceView licenceview = (LicenceView) new LicenceViewImpl();
	private final CreatUserView creatuserview = (CreatUserView) new CreatUserViewImpl();
	private final MapView mapview=(MapView) new MapViewImpl();
	private final MessageOutView messageOutview =(MessageOutView) new MessageOutViewImpl();
	private final MessageInView messageInview =(MessageInView) new MessageInViewImpl();
	private final SettingsView settingsview = (SettingsView) new SettingsViewImpl();
	
	public ClientFactoryImpl(UserServiceAsync USA, JourneyServiceAsync JSA, MessageServiceAsync MSA){
		this.USA=USA;
		this.JSA=JSA;
		this.MSA=MSA;
	}

	public MessageServiceAsync getMSA(){
		return MSA;
	}
	public UserServiceAsync getUSA(){
		return USA;
	}
	public JourneyServiceAsync getJSA(){
		return JSA;
	}
	@Override
	public EventBus getEventBus() {
		return eventBus;
	}

	@Override
	public PlaceController getPlaceController() {
		return placeController;
	}

	@Override
	public WelcomView getWelcomView() {
		return welcomview;
	}

	@Override
	public I18nView getI18nView() {
		
		return i18nview;
	}

	@Override
	public LicenceView getLicenceView() {
		return licenceview;
	}

	@Override
	public CreatUserView getCreatUserView() {
		return creatuserview;
	}

	@Override
	public MapView getMapView() {
		return mapview;
	}

	@Override
	public MessageInView getMessageInView() {
		return messageInview;
	}
	@Override
	public MessageOutView getMessageOutView() {
		return messageOutview;
	}

	@Override
	public SettingsView getSettingsView() {
		return settingsview;
	}

}
